package com.whately.core.base.fileupload.constant;

import lombok.Getter;

/**
 * 文件存储方式
 */
@Getter
public enum FileStoreTypeEnum {

    //根据请求地址，重新构建，再redirect到本地图片服务器，加载图片流输出
    //imgFetchType_request(0,"根据请求地址，重新构建，再redirect到本地图片服务器，加载图片流输出"),


    //本地搭建的图片服务器
    //imgFetchType_file_server(1,"本地搭建的图片服务器"),


    //七牛云服务器
    qiniu_server(2,"七牛云服务器"),


    fdfs_server(3,"fdfs服务器"),

    minio_server(4,"minio服务器"),

    hadoop_dfs_server(5,"minio服务器"),

    ;


    Integer code;
    String text;

    private FileStoreTypeEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public static FileStoreTypeEnum getEnumByCode(Integer code){
        if(code==null){
            return null;
        }

        for(FileStoreTypeEnum e: FileStoreTypeEnum.values()){
            if(e.code.equals(code)){
                return e;
            }
        }
        return null;
    }


}
